﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="Scripts/jquery-1.6.4.js" type="text/javascript"></script>
    <script type="text/javascript">


        var childArray = new Array();
        $(document).ready(function () {
            $("#Button1").click(function () {

                childArray.push(window.open("/ChildPage.htm", "_child",
                "toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=yes, width=400, height=400"));
                childArray.push(window.open("/HelloT.htm"));
            });
            $("#Button2").click(function () {
                for (index in childArray) {  //在此处不能用item 替代x  item是个函数。
                    childArray[index].close();
                }
            });
        });


    </script>
</head>
<body>
    <input id="Button1" type="button" value="打开子页面" />
    <input id="Button2" type="button" value="关闭由它打开的页面 " />
</body>
</html>
